import { request } from '../request';

// 获取batch列表
export function fetchCheckBatch(params?: Api.SystemManage.BatchSearchParams){
    return request<Api.SystemManage.BatchList>({
        url: '/batch/page',
        method: 'get',
        params
    });
}


// 根据batch id获取hospCheckCategoty
export async function fetchBatchHospCategory(id: string){
    // console.log(id)
    const res =  request<Api.SystemManage.HospCheckCategoryList>({
        url: `/hospCheckCategory/batch/${id}`,
        method: 'get'
    });
    // console.log(res);
    return res;
}

// 用于初始化
export async function fetchCategoryItems(id: string){
    const res = request<Api.SystemManage.CategoryScoreVo>({
        url: `/hospCheckCategory/category/${id}`,
        method: 'get'
    });
    // console.log(res);
    return res;
}

// 获取该考核项目下已完成的区域id
export async function fetchCategoryCompletedAreas(id: string){
    return request<string[]>({
        url: `/hospCheckCategory/category/check/${id}`,
        method: 'get',
    });
}

// 提交打分该区域的打分
export async function commitAreaScore(params: Api.SystemManage.AreaScoreVo){
    return request({
        url: '/hospCheckCategory/score/area',
        method: 'POST',
        data: params
    });
}


// 提交该项目的打分 
export async function commitCategoryScore(id: string){
    console.log(id)
    return request({
        url: `/hospCheckCategory/score/category/${id}`,
        method: 'get',
    });
}
 